package com.example.demo.bean;

import java.util.Objects;

/**
 * @author Jim Chen
 * @date 2021-04-15
 */
public class Word {

    private Long id;
    /**
     * 类型
     */
    private String type;

    /**
     * 分类
     */
    private String catalog;

    /**
     * 英文简写
     */
    private String englishAbbr;

    /**
     * 中文名称
     */
    private String chineseName;

    /**
     * 英文名称
     */
    private String englishName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCatalog() {
        return catalog;
    }

    public void setCatalog(String catalog) {
        this.catalog = catalog;
    }

    public String getEnglishAbbr() {
        return englishAbbr;
    }

    public void setEnglishAbbr(String englishAbbr) {
        this.englishAbbr = englishAbbr;
    }

    public String getChineseName() {
        return chineseName;
    }

    public void setChineseName(String chineseName) {
        this.chineseName = chineseName;
    }

    public String getEnglishName() {
        return englishName;
    }

    public void setEnglishName(String englishName) {
        this.englishName = englishName;
    }

    public Word(String type, String catalog, String englishAbbr, String chineseName, String englishName) {
        this.type = type;
        this.catalog = catalog;
        this.englishAbbr = englishAbbr;
        this.chineseName = chineseName;
        this.englishName = englishName;
    }

    public Word(Long id, String type, String catalog, String englishAbbr, String chineseName, String englishName) {
        this.id = id;
        this.type = type;
        this.catalog = catalog;
        this.englishAbbr = englishAbbr;
        this.chineseName = chineseName;
        this.englishName = englishName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Word word = (Word) o;
        return Objects.equals(id, word.id) &&
                Objects.equals(type, word.type) &&
                Objects.equals(catalog, word.catalog) &&
                Objects.equals(englishAbbr, word.englishAbbr) &&
                Objects.equals(chineseName, word.chineseName) &&
                Objects.equals(englishName, word.englishName);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, type, catalog, englishAbbr, chineseName, englishName);
    }
}
